package com.bawei.lib_net.interceptor

import android.os.Build
import com.bawei.lib_storage.mmkv.AppMMKV
import com.bawei.lib_storage.mmkv.AuthMMKV
import com.tencent.mmkv.MMKV
import okhttp3.Interceptor
import okhttp3.Response

/**
 *作者：lxy
 *功能:请求头拦截器
 *时间：2025/5/23
 */
class HttpHeaderInterceptor : Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        val originRequest = chain.request()
        val newRequest = originRequest.newBuilder()
            .addHeader("Content-Language", "")
            .addHeader("platform", "ANDROID")
            .addHeader("source", "CLUB_APP")
            .addHeader("Authorization", AuthMMKV.access_token)
            .addHeader("meid", "")
            .addHeader("version", "")
            .addHeader("phoneModel", Build.BRAND + "_" + Build.MODEL)
            .build()
        return chain.proceed(newRequest)
    }
}